from typing import Dict, Any, Optional, Literal
from pydantic import BaseModel

Role = Literal["user", "sales", "supplier"]


class ChatMessage(BaseModel):
	role: Role
	content: str
	action: Optional[str] = None
	params: Optional[Dict[str, Any]] = None


class ActionRequest(BaseModel):
	role: Role
	action: str
	params: Optional[Dict[str, Any]] = None


class MessageResponse(BaseModel):
	id: str
	role: Role
	type: Literal["text", "form"]
	content: str
	extra: Optional[Dict[str, Any]] = None
	timestamp: str


